home *** CD-ROM | disk | FTP | other *** search
- 0 rem home inventory 64 - ian adam
- 10 nf$="none"
- 20 print"[147] * home inventory by ian adam"
- 30 print""
- 40 print"file name:",nf$
- 50 print"total rooms ",nr
- 60 print"items per room",ni
- 70 print"items entered ",ci
- 80 print"the main menu"
- 90 sa=7:k=198:m$(0)="end"
- 100 m$(1)="create file"
- 110 m$(2)="get file from disk"
- 120 m$(3)="work on data"
- 130 m$(4)="save to disk"
- 140 m$(5)="printed report"
- 150 for i=0 to 5
- 160 printi;m$(i):next
- 170 print"choice?":wait k,7
- 171 get a$:ifa$="" then 171
- 172 a=val(a$)
- 180 print:print"[147]"m$(a)
- 190 if a>2 and nr=0 then input"no data!";a$:run
- 200 if a>2 or nr=0 then 220
- 210 print"are you sure? y/n":wait k,7:get a$:if a$<"y" then 20
- 220 on a+1 gosub 230,690,250,820,410,1690:goto 20
- 230 end
- 240 :
- 250 clr:d$=",s,r"
- 260 gosub 560:if a>19 then run
- 270 input#1,a,b
- 280 print"file "nf$" allows"a
- 290 print"rooms, &"b"items per room."
- 300 print"press return if ok, or enter:"
- 310 i=a:j=b:gosub 740
- 320 :
- 330 for i=1 to a
- 340 input#1,nr$(i),ir(i)
- 350 for j=1 to ir(i)
- 360 input#1,it$(i,j),id$(i,j),ag(i,j),nv(i,j),pv(i,j)
- 370 next:if j>ni then ir(i)=ni
- 380 next
- 390 gosub 520:gosub 1650:goto 20
- 400 :
- 410 print"press return for: "nf$
- 420 d$=",s,w"
- 430 gosub 560:if a>19 then return
- 440 print#1,nr:print#1,ni:b$=" "
- 450 for i=1 to nr
- 460 print#1,b$+nr$(i):print#1,ir(i)
- 470 for j=1 to ir(i)
- 480 print#1,b$+it$(i,j):print#1,b$+id$(i,j)
- 490 print#1,ag(i,j):print#1,nv(i,j):print#1,pv(i,j)
- 500 next:next
- 510 :
- 520 close1:input#2,a,b$:close2
- 530 if a>19 then print"problem: "b$:input"return";a$
- 540 return
- 550 :
- 560 input"file name";nf$
- 570 df$=left$(nf$,12)+".inv"
- 580 d$="0:"+df$+d$
- 590 open2,8,15
- 600 open1,8,8,d$
- 610 input#2,a,a$
- 620 if a<20 then return
- 630 printa$:close1:close2
- 640 if a-63 then input"return";a$:return
- 650 print"replace old file? y/n":wait k,7:get a$
- 660 if a$<"y" then return
- 670 open2,8,15,"s0:"+df$:goto 600
- 680 :
- 690 clr:input"file name";nf$
- 700 print"items are grouped by"
- 710 print"the room they are kept in."
- 720 gosub 740:goto 20
- 730 :
- 740 input"maximum # of rooms";i
- 750 input"maximum items per room";j
- 760 nr=i:ni=j
- 770 if a>i then i=a
- 780 if b>j then j=b
- 790 dim it$(i,j),id$(i,j),ag(i,j),nv(i,j),pv(i,j),nr$(i),ir(i)
- 800 return
- 810 :
- 820 gosub 1200
- 830 input"work on which room (q quit)";a$
- 840 a=val(a$):if a then 880
- 850 for i=1 to nr
- 860 if a$=nr$(i) then a=i
- 870 next
- 880 if a<1 or a>nr then 1650
- 890 if ir(a)=0 then gosub 1020
- 900 print:print"room"a,nr$(a),"items:"ir(a)
- 910 print" 0. main menu"
- 920 print" 1. add items"
- 930 print" 2. list items"
- 940 print" 3. item details"
- 950 print" 4. modify data"
- 960 print" 5. another room"
- 970 print"choice?":wait k,7:get a$:b=val(a$)
- 980 if b<1 then 1650
- 990 if b>4 then 820
- 1000 print:on b gosub 1040,1250,1100,1140:goto 900
- 1010 :
- 1020 if nr$(a)="" then input"name of room";nr$(a)
- 1030 :
- 1040 b=ir(a)+1:gosub 1560
- 1050 if b>ni then input"room is full: return";a$:return
- 1060 gosub 1400
- 1070 if a$="q" then return
- 1080 ir(a)=b:b=b+1:goto 1050
- 1090 :
- 1100 input"detail item # (0 quit)";b
- 1110 if b<1 or b>ir(a) then return
- 1120 gosub 1310:goto 1100
- 1130 :
- 1140 print"press return at any prompt to"
- 1150 print"keep the same data.":print
- 1160 input"modify which item # (0 quit)";b
- 1170 if b<1 or b>ir(a) then return
- 1180 gosub 1400:goto 1140
- 1190 :
- 1200 print:print"rooms",,,"items"
- 1210 for i=1 to nr
- 1220 printi,nr$(i)tab(32)ir(i)
- 1230 next:return
- 1240 :
- 1250 print"[147]"
- 1260 for i=1 to ir(a)
- 1270 printi;it$(a,i)
- 1280 next:if ir(a)>16 then input"return";a$
- 1290 return
- 1300 :
- 1310 print"room:",nr$(a)
- 1320 print"item #:",b
- 1330 print"descrip:",it$(a,b)
- 1340 print"ident:",id$(a,b)
- 1350 print"age, yrs:",ag(a,b)
- 1360 print"cost:",nv(a,b)
- 1370 print"value:",pv(a,b)
- 1380 print:return
- 1390 :
- 1400 print"[147]room:",nr$(a)
- 1410 print"item #"b"description (q: to quit):"
- 1420 printtab(2)it$(a,b)
- 1430 print"":inputa$
- 1440 if a$="q" then return
- 1450 it$(a,b)=a$
- 1460 print"id: "id$(a,b)
- 1470 print"";:inputid$(a,b)
- 1480 print"age, yrs:",ag(a,b)
- 1490 print"[145]"tab(9);:inputag(a,b)
- 1500 print"original cost: "nv(a,b)
- 1510 print"[145]"tab(14);:inputnv(a,b)
- 1520 print"present value: "pv(a,b)
- 1530 print"[145]"tab(14);:inputpv(a,b)
- 1540 return
- 1550 :
- 1560 print"[147]for each item, give a description"
- 1570 print"including make, size, condition, etc."
- 1580 print"give an identification such as serial # or other marks."
- 1590 print"commas & colons not allowed as input."
- 1600 print"age is in years."
- 1610 print"cost is original price of item,"
- 1620 print"& estimate the current value."
- 1630 print"press space bar":wait k,7:get a$
- 1640 :
- 1650 ci=0:for i=1 to nr
- 1660 ci=ci+ir(i):next
- 1670 return
- 1680 :
- 1690 print"ensure printer is ready"
- 1700 gosub 1200
- 1710 input"start report at room 1[157][157][157]";s
- 1720 print"end report at room "nr
- 1730 print"[145]"tab(18);:inpute:print
- 1740 if s<1 or s>e or e>nr then return
- 1750 :
- 1760 print"[147]description & id may be cut to fit."
- 1770 print"your options:":print
- 1780 print"0. summarize data"
- 1790 print"1. short id, age & cost table"
- 1800 print"2. full descriptions & id's only"
- 1810 print"3. full report"
- 1820 print"4. set secondary address"
- 1830 print"5. cancel"
- 1840 print"your choice?":wait k,7:get a$:m=val(a$)
- 1850 if m<4 then 1900
- 1860 if m>4 then return
- 1870 print"secondary address is"sa"for upper/lower"
- 1880 print"case, & line feeds:":input"new value";sa:??{$7f}a0
- 1890 :
- 1900 open4,4,sa:cmd 4:print:print
- 1910 printchr$(14)"home inventory"
- 1920 print"file: "nf$
- 1930 t1=0:t2=0:t3=0:b$=" "
- 1940 for a=s to e:i=0:j=0
- 1950 print:printchr$(14)"room"a;nr$(a):printchr$(15)
- 1960 if ir(a)=0 then 2020
- 1970 if mand1 then print" # description"spc(35)"id"spc(13)"age cost value"
- 1980 for b=1 to ir(a)
- 1990 i=i+nv(a,b):j=j+pv(a,b):on m gosub 2180,2220,2160
- 2000 next
- 2010 :
- 2020 print"total, room"a
- 2030 b=ir(a):gosub 2110
- 2040 t1=t1+b:t2=t2+i:t3=t3+j
- 2050 next:print
- 2060 :
- 2070 if s=e then 2100
- 2080 printchr$(14)"total for rooms"s"to"e:printchr$(15)
- 2090 b=t1:i=t2:j=t3:gosub 2110
- 2100 print#4:close4:return
- 2110 printb$"items:"spc(8)b
- 2120 printb$"original cost:"i
- 2130 printb$"present value:"j
- 2140 return
- 2150 :
- 2160 if len(it$(a,b))>46 then printit$(a,b)
- 2170 if len(id$(a,b))>15 then printid$(a,b)
- 2180 printright$(b$+str$(b)+" ",4)left$(it$(a,b)+b$+b$+b$,46);
- 2190 printleft$(id$(a,b)+b$,15)right$(b$+str$(ag(a,b)),3);
- 2200 printright$(b$+str$(nv(a,b)),6)right$(b$+str$(pv(a,b)),6)
- 2210 return
- 2220 printit$(a,b):printid$(a,b):print:return
-